package command;

import org.uc3m.ed.factory.panel.FactoriaPanel;
import org.uc3m.ed.implementacion.Command;
import org.uc3m.ed.interfaz_grafica.ventana.PanelDibujo;
import org.uc3m.ed.interfaz_grafica.ventana.VentanaPrincipal;
import org.uc3m.ed.tad.arbol.Heap;

public class CommandCrearHeap implements Command {

	/* (non-Javadoc)
	 * @see org.uc3m.ed.implementacion.Command#execute()
	 */
	public void execute() {
		try{
			PanelDibujo panel =FactoriaPanel.metodoFactoria();
			VentanaPrincipal.getConsola().limpiarConsola();
			panel.initPilaComandos();
			panel.setEstructura(new Heap<Integer,Integer>());
			panel.repaint();	
		}catch(Error e){
			VentanaPrincipal.getConsola().escribirTextoError("CLASS::Heap::CommandCrearABB ERROR::1::"+e.toString()+"\n",e.getStackTrace());
		}catch(Exception e){
			VentanaPrincipal.getConsola().escribirTextoError("CLASS::Heap::CommandCrearABB ERROR::2::"+e.toString()+"\n",e.getStackTrace());
		}
				

	}

}
